#ifndef __JGDATETIME_H__
#define __JGDATETIME_H__

#include <ctime>
#include <string>
#include <cstring>
#include "jgcxtools.h"

using namespace std;

class _DLL_API_ jgdatetime
{
private:
    time_t m_time;
public:
    jgdatetime();
    ~jgdatetime();

    jgdatetime(long timestamp);

    static jgdatetime now();
    long getTimestamp();
    string toString(string format="%Y-%m-%d %H:%M:%S");
    jgdatetime addday(int day);
    jgdatetime addhour(int hour);
    jgdatetime addsec(int sec);
    jgdatetime addmin(int min);
    static jgdatetime setTimeFormat(string strF="2022-09-26 13:35:24");
};




#endif // __JGDATETIME_H__